#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int get_sum(char *arr)
{
    int sum = 0;

    char *p = NULL;
    p = strtok(arr, ",");
    while (p != NULL)
    {
        sum += atoi(p);
        p = strtok(NULL, ",");
    }
    return sum;
}
int main(int argc, char const *argv[])
{
    //char a[100] = "12,43,65,13,97,54,19";
    char a[100] = "10,40,60,130,90,50,190";
    int sum = 0;
    sum = get_sum(a);
    printf("sum=%d\n", sum);
    return 0;
}
